package com.diamond.util;

import com.diamond.bo.SDiamondBO;

public class QueryDiamondAtt {
	
	/**
	 * 查询钻石的各个属性的全写和简写
	 * 荧光的属性缩写和全写
	 * @param sDiamondBO
	 * @return
	 */
	public static String getDiamondAttToFluor(SDiamondBO sDiamondBo) {
		StringBuilder fluorStr = new StringBuilder();
		String[] fluors = sDiamondBo.getFluorescence();
		for (int i = 0; i < fluors.length; i++) {
			if(i < fluors.length - 1) {
				if ("N".equals(fluors[i]) || "NONE".equals(fluors[i])) {
					fluorStr.append("'").append("N").append("','").append("NONE").append("','").append("NON").append("',");
				} else if ("F".equals(fluors[i]) || "FAINT".equals(fluors[i])) {
					fluorStr.append("'").append("F").append("','").append("FAINT").append("','").append("FNT").append("',");
				} else if ("M".equals(fluors[i]) || "MEDIUM".equals(fluors[i])) {
					fluorStr.append("'").append("M").append("','").append("MEDIUM").append("','").append("MEDIUM BLUE").append("',");
				} else if ("ST".equals(fluors[i]) || "STRONG".equals(fluors[i])) {
					fluorStr.append("'").append("ST").append("','").append("STRONG").append("',");
				} else if ("VST".equals(fluors[i]) || "VERYSTRONG".equals(fluors[i]) || "VERY STRONG".equals(fluors[i])) {
					fluorStr.append("'").append("VST").append("','").append("VERY STRONG").append("','").append("VS").append("',");
				}
			} else {
				if ("N".equals(fluors[i]) || "NONE".equals(fluors[i])) {
					fluorStr.append("'").append("N").append("','").append("NONE").append("','").append("NON").append("'");
				} else if ("F".equals(fluors[i]) || "FAINT".equals(fluors[i])) {
					fluorStr.append("'").append("F").append("','").append("FAINT").append("','").append("FNT").append("'");
				} else if ("M".equals(fluors[i]) || "MEDIUM".equals(fluors[i])) {
					fluorStr.append("'").append("M").append("','").append("MEDIUM").append("','").append("MEDIUM BLUE").append("','").append("MED").append("'");
				} else if ("ST".equals(fluors[i]) || "STRONG".equals(fluors[i])) {
					fluorStr.append("'").append("ST").append("','").append("STRONG").append("'");
				} else if ("VST".equals(fluors[i]) || "VERYSTRONG".equals(fluors[i]) || "VERY STRONG".equals(fluors[i])) {
					fluorStr.append("'").append("VST").append("','").append("VERY STRONG").append("','").append("VS").append("'");
				}
			}
		}
		return fluorStr.toString();
	}
	
	/**
	 * 查询钻石的各个属性的全写和简写
	 * 抛光的属性缩写和全写
	 * @param sDiamondBO
	 * @return
	 */
	public static String getDiamondAttToPolish(SDiamondBO sDiamondBo) {
		StringBuilder polishStr = new StringBuilder();
		String[] polishs = sDiamondBo.getBuffing();
		for (int i = 0; i < polishs.length; i++) {
			if(i < polishs.length - 1) {
				if ("IDEAL".equals(polishs[i])) {
					polishStr.append("'").append("IDEAL").append("',");
				} else if ("EX".equals(polishs[i]) || "EXCELLENT".equals(polishs[i])) {
					polishStr.append("'").append("EX").append("','").append("EXCELLENT").append("',");
				} else if ("G".equals(polishs[i]) || "GOOD".equals(polishs[i])) {
					polishStr.append("'").append("G").append("','").append("GOOD").append("',");
				} else if ("VG".equals(polishs[i]) || "VERY GOOD".equals(polishs[i])) {
					polishStr.append("'").append("VG").append("','").append("VERY GOOD").append("',");
				} else if ("F".equals(polishs[i]) || "FAIL".equals(polishs[i])) {
					polishStr.append("'").append("F").append("','").append("FAIL").append("',");
				}
			} else {
				if ("IDEAL".equals(polishs[i])) {
					polishStr.append("'").append("IDEAL").append("'");
				} else if ("EX".equals(polishs[i]) || "EXCELLENT".equals(polishs[i])) {
					polishStr.append("'").append("EX").append("','").append("EXCELLENT").append("'");
				} else if ("G".equals(polishs[i]) || "GOOD".equals(polishs[i])) {
					polishStr.append("'").append("G").append("','").append("GOOD").append("'");
				} else if ("VG".equals(polishs[i]) || "VERY GOOD".equals(polishs[i])) {
					polishStr.append("'").append("VG").append("','").append("VERY GOOD").append("'");
				} else if ("F".equals(polishs[i]) || "FAIL".equals(polishs[i])) {
					polishStr.append("'").append("F").append("','").append("FAIL").append("'");
				}
			}
		}
		return polishStr.toString();
	}
	
	/**
	 * 查询钻石的各个属性的全写和简写
	 * 切工的属性缩写和全写
	 * @param sDiamondBO
	 * @return
	 */
	public static String getDiamondAttToCut(SDiamondBO sDiamondBo) {
		StringBuilder cutStr = new StringBuilder();
		String[] cuts = sDiamondBo.getCutter();
		for (int i = 0; i < cuts.length; i++) {
			if(i < cuts.length - 1) {
				if ("IDEAL".equals(cuts[i])) {
					cutStr.append("'").append("IDEAL").append("',");
				} else if ("EX".equals(cuts[i]) || "EXCELLENT".equals(cuts[i])) {
					cutStr.append("'").append("EX").append("','").append("EXCELLENT").append("',");
				} else if ("G".equals(cuts[i]) || "GOOD".equals(cuts[i])) {
					cutStr.append("'").append("G").append("','").append("GOOD").append("',");
				} else if ("VG".equals(cuts[i]) || "VERY GOOD".equals(cuts[i])) {
					cutStr.append("'").append("VG").append("','").append("VERY GOOD").append("',");
				} else if ("F".equals(cuts[i]) || "FAIL".equals(cuts[i])) {
					cutStr.append("'").append("F").append("','").append("FAIL").append("',");
				}
			} else {
				if ("IDEAL".equals(cuts[i])) {
					cutStr.append("'").append("IDEAL").append("'");
				} else if ("EX".equals(cuts[i]) || "EXCELLENT".equals(cuts[i])) {
					cutStr.append("'").append("EX").append("','").append("EXCELLENT").append("'");
				} else if ("G".equals(cuts[i]) || "GOOD".equals(cuts[i])) {
					cutStr.append("'").append("G").append("','").append("GOOD").append("'");
				} else if ("VG".equals(cuts[i]) || "VERY GOOD".equals(cuts[i])) {
					cutStr.append("'").append("VG").append("','").append("VERY GOOD").append("'");
				} else if ("F".equals(cuts[i]) || "FAIL".equals(cuts[i])) {
					cutStr.append("'").append("F").append("','").append("FAIL").append("'");
				}
			}
		}
		return cutStr.toString();
	}
	
	/**
	 * 查询钻石的各个属性的全写和简写
	 * 对称性的属性缩写和全写
	 * @param sDiamondBO
	 * @return
	 */
	public static String getDiamondAttToSymmetry(SDiamondBO sDiamondBo) {
		StringBuilder symmetryStr = new StringBuilder();
		String[] symmetrys = sDiamondBo.getSymmetry();
		for (int i = 0; i < symmetrys.length; i++) {
			if(i < symmetrys.length - 1) {
				if ("IDEAL".equals(symmetrys[i])) {
					symmetryStr.append("'").append("IDEAL").append("',");
				} else if ("EX".equals(symmetrys[i]) || "EXCELLENT".equals(symmetrys[i])) {
					symmetryStr.append("'").append("EX").append("','").append("EXCELLENT").append("',");
				} else if ("G".equals(symmetrys[i]) || "GOOD".equals(symmetrys[i])) {
					symmetryStr.append("'").append("G").append("','").append("GOOD").append("',");
				} else if ("VG".equals(symmetrys[i]) || "VERY GOOD".equals(symmetrys[i])) {
					symmetryStr.append("'").append("VG").append("','").append("VERY GOOD").append("',");
				} else if ("F".equals(symmetrys[i]) || "FAIL".equals(symmetrys[i])) {
					symmetryStr.append("'").append("F").append("','").append("FAIL").append("',");
				}
			} else {
				if ("IDEAL".equals(symmetrys[i])) {
					symmetryStr.append("'").append("IDEAL").append("'");
				} else if ("EX".equals(symmetrys[i]) || "EXCELLENT".equals(symmetrys[i])) {
					symmetryStr.append("'").append("EX").append("','").append("EXCELLENT").append("'");
				} else if ("G".equals(symmetrys[i]) || "GOOD".equals(symmetrys[i])) {
					symmetryStr.append("'").append("G").append("','").append("GOOD").append("'");
				} else if ("VG".equals(symmetrys[i]) || "VERY GOOD".equals(symmetrys[i])) {
					symmetryStr.append("'").append("VG").append("','").append("VERY GOOD").append("'");
				} else if ("F".equals(symmetrys[i]) || "FAIL".equals(symmetrys[i])) {
					symmetryStr.append("'").append("F").append("','").append("FAIL").append("'");
				}
			}
		}
		return symmetryStr.toString();
	}
}
